3.1217 \(\int \frac{(a+b \tan (e+f x))^3}{(c+d \tan (e+f x))^2} \, dx\)

Optimal. Leaf size=223 \[ \frac{\left (-3 a^2 b \left (c^2-d^2\right )+2 a^3 c d-6 a b^2 c d+b^3 \left (c^2-d^2\right )\right ) \log (\cos (e+f x))}{f \left (c^2+d^2\right )^2}+\frac{x \left (6 a^2 b c d+a^3 \left (c^2-d^2\right )-3 a b^2 \left (c^2-d^2\right )-2 b^3 c d\right )}{\left (c^2+d^2\right )^2}-\frac{(b c-a d)^2 (a+b \tan (e+f x))}{d f \left (c^2+d^2\right ) (c+d \tan (e+f x))}+\frac{\left (2 a c d+b \left (c^2+3 d^2\right )\right ) (b c-a d)^2 \log (c+d \tan (e+f x))}{d^2 f \left (c^2+d^2\right )^2} \]

[Out]

((6*a^2*b*c*d - 2*b^3*c*d + a^3*(c^2 - d^2) - 3*a*b^2*(c^2 - d^2))*x)/(c^2 + d^2)^2 + ((2*a^3*c*d - 6*a*b^2*c*
d - 3*a^2*b*(c^2 - d^2) + b^3*(c^2 - d^2))*Log[Cos[e + f*x]])/((c^2 + d^2)^2*f) + ((b*c - a*d)^2*(2*a*c*d + b*
(c^2 + 3*d^2))*Log[c + d*Tan[e + f*x]])/(d^2*(c^2 + d^2)^2*f) - ((b*c - a*d)^2*(a + b*Tan[e + f*x]))/(d*(c^2 +
 d^2)*f*(c + d*Tan[e + f*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.363817, antiderivative size = 223, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {3565, 3626, 3617, 31, 3475} \[ \frac{\left (-3 a^2 b \left (c^2-d^2\right )+2 a^3 c d-6 a b^2 c d+b^3 \left (c^2-d^2\right )\right ) \log (\cos (e+f x))}{f \left (c^2+d^2\right )^2}+\frac{x \left (6 a^2 b c d+a^3 \left (c^2-d^2\right )-3 a b^2 \left (c^2-d^2\right )-2 b^3 c d\right )}{\left (c^2+d^2\right )^2}-\frac{(b c-a d)^2 (a+b \tan (e+f x))}{d f \left (c^2+d^2\right ) (c+d \tan (e+f x))}+\frac{\left (2 a c d+b \left (c^2+3 d^2\right )\right ) (b c-a d)^2 \log (c+d \tan (e+f x))}{d^2 f \left (c^2+d^2\right )^2} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Tan[e + f*x])^3/(c + d*Tan[e + f*x])^2,x]

[Out]

((6*a^2*b*c*d - 2*b^3*c*d + a^3*(c^2 - d^2) - 3*a*b^2*(c^2 - d^2))*x)/(c^2 + d^2)^2 + ((2*a^3*c*d - 6*a*b^2*c*
d - 3*a^2*b*(c^2 - d^2) + b^3*(c^2 - d^2))*Log[Cos[e + f*x]])/((c^2 + d^2)^2*f) + ((b*c - a*d)^2*(2*a*c*d + b*
(c^2 + 3*d^2))*Log[c + d*Tan[e + f*x]])/(d^2*(c^2 + d^2)^2*f) - ((b*c - a*d)^2*(a + b*Tan[e + f*x]))/(d*(c^2 +
 d^2)*f*(c + d*Tan[e + f*x]))

Rule 3565

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si
mp[((b*c - a*d)^2*(a + b*Tan[e + f*x])^(m - 2)*(c + d*Tan[e + f*x])^(n + 1))/(d*f*(n + 1)*(c^2 + d^2)), x] - D
ist[1/(d*(n + 1)*(c^2 + d^2)), Int[(a + b*Tan[e + f*x])^(m - 3)*(c + d*Tan[e + f*x])^(n + 1)*Simp[a^2*d*(b*d*(
m - 2) - a*c*(n + 1)) + b*(b*c - 2*a*d)*(b*c*(m - 2) + a*d*(n + 1)) - d*(n + 1)*(3*a^2*b*c - b^3*c - a^3*d + 3
*a*b^2*d)*Tan[e + f*x] - b*(a*d*(2*b*c - a*d)*(m + n - 1) - b^2*(c^2*(m - 2) - d^2*(n + 1)))*Tan[e + f*x]^2, x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && Gt
Q[m, 2] && LtQ[n, -1] && IntegerQ[2*m]

Rule 3626

Int[((A_) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2)/((a_.) + (b_.)*tan[(e_.) + (f_.)*
(x_)]), x_Symbol] :> Simp[((a*A + b*B - a*C)*x)/(a^2 + b^2), x] + (Dist[(A*b^2 - a*b*B + a^2*C)/(a^2 + b^2), I
nt[(1 + Tan[e + f*x]^2)/(a + b*Tan[e + f*x]), x], x] - Dist[(A*b - a*B - b*C)/(a^2 + b^2), Int[Tan[e + f*x], x
], x]) /; FreeQ[{a, b, e, f, A, B, C}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0] && NeQ[a^2 + b^2, 0] && NeQ[A*b - a
*B - b*C, 0]

Rule 3617

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[
A/(b*f), Subst[Int[(a + x)^m, x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, A, C, m}, x] && EqQ[A, C]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{(a+b \tan (e+f x))^3}{(c+d \tan (e+f x))^2} \, dx &=-\frac{(b c-a d)^2 (a+b \tan (e+f x))}{d \left (c^2+d^2\right ) f (c+d \tan (e+f x))}+\frac{\int \frac{b^3 c^2+a^3 c d-3 a b^2 c d+3 a^2 b d^2+d \left (3 a^2 b c-b^3 c-a^3 d+3 a b^2 d\right ) \tan (e+f x)+b^3 \left (c^2+d^2\right ) \tan ^2(e+f x)}{c+d \tan (e+f x)} \, dx}{d \left (c^2+d^2\right )}\\ &=\frac{\left (6 a^2 b c d-2 b^3 c d+a^3 \left (c^2-d^2\right )-3 a b^2 \left (c^2-d^2\right )\right ) x}{\left (c^2+d^2\right )^2}-\frac{(b c-a d)^2 (a+b \tan (e+f x))}{d \left (c^2+d^2\right ) f (c+d \tan (e+f x))}-\frac{\left (2 a^3 c d-6 a b^2 c d-3 a^2 b \left (c^2-d^2\right )+b^3 \left (c^2-d^2\right )\right ) \int \tan (e+f x) \, dx}{\left (c^2+d^2\right )^2}+\frac{\left ((b c-a d)^2 \left (2 a c d+b \left (c^2+3 d^2\right )\right )\right ) \int \frac{1+\tan ^2(e+f x)}{c+d \tan (e+f x)} \, dx}{d \left (c^2+d^2\right )^2}\\ &=\frac{\left (6 a^2 b c d-2 b^3 c d+a^3 \left (c^2-d^2\right )-3 a b^2 \left (c^2-d^2\right )\right ) x}{\left (c^2+d^2\right )^2}+\frac{\left (2 a^3 c d-6 a b^2 c d-3 a^2 b \left (c^2-d^2\right )+b^3 \left (c^2-d^2\right )\right ) \log (\cos (e+f x))}{\left (c^2+d^2\right )^2 f}-\frac{(b c-a d)^2 (a+b \tan (e+f x))}{d \left (c^2+d^2\right ) f (c+d \tan (e+f x))}+\frac{\left ((b c-a d)^2 \left (2 a c d+b \left (c^2+3 d^2\right )\right )\right ) \operatorname{Subst}\left (\int \frac{1}{c+x} \, dx,x,d \tan (e+f x)\right )}{d^2 \left (c^2+d^2\right )^2 f}\\ &=\frac{\left (6 a^2 b c d-2 b^3 c d+a^3 \left (c^2-d^2\right )-3 a b^2 \left (c^2-d^2\right )\right ) x}{\left (c^2+d^2\right )^2}+\frac{\left (2 a^3 c d-6 a b^2 c d-3 a^2 b \left (c^2-d^2\right )+b^3 \left (c^2-d^2\right )\right ) \log (\cos (e+f x))}{\left (c^2+d^2\right )^2 f}+\frac{(b c-a d)^2 \left (2 a c d+b \left (c^2+3 d^2\right )\right ) \log (c+d \tan (e+f x))}{d^2 \left (c^2+d^2\right )^2 f}-\frac{(b c-a d)^2 (a+b \tan (e+f x))}{d \left (c^2+d^2\right ) f (c+d \tan (e+f x))}\\ \end{align*}

Mathematica [C]  time = 4.53075, size = 538, normalized size = 2.41 \[ \frac{\cos (e+f x) (a+b \tan (e+f x))^3 (c \cos (e+f x)+d \sin (e+f x)) \left (c^2 \cos (e+f x) \left (2 (c+i d)^2 (e+f x) \left (-3 i a^2 b d^2+a^3 d^2-3 a b^2 d^2+b^3 c (2 d+i c)\right )+(b c-a d)^2 \left (2 a c d+b \left (c^2+3 d^2\right )\right ) \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )-2 b^3 \left (c^2+d^2\right )^2 \log (\cos (e+f x))\right )+d \sin (e+f x) \left (2 (c+i d) \left (3 a^2 b c d^2 (d (e+f x+i)-i c (e+f x-i))+a^3 d^2 \left (c^2 (e+f x)+c d (i e+i f x+1)-i d^2\right )+3 a b^2 c d \left (c^2-c d (e+f x+i)-i d^2 (e+f x)\right )+b^3 c^2 \left (i c^2 (e+f x+i)+c d (e+f x+i)+2 i d^2 (e+f x)\right )\right )+c (b c-a d)^2 \left (2 a c d+b \left (c^2+3 d^2\right )\right ) \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )-2 b^3 c \left (c^2+d^2\right )^2 \log (\cos (e+f x))\right )-2 i c (b c-a d)^2 \left (2 a c d+b \left (c^2+3 d^2\right )\right ) \tan ^{-1}(\tan (e+f x)) (c \cos (e+f x)+d \sin (e+f x))\right )}{2 c d^2 f (c-i d)^2 (c+i d)^2 (c+d \tan (e+f x))^2 (a \cos (e+f x)+b \sin (e+f x))^3} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Tan[e + f*x])^3/(c + d*Tan[e + f*x])^2,x]

[Out]

(Cos[e + f*x]*(c*Cos[e + f*x] + d*Sin[e + f*x])*(c^2*Cos[e + f*x]*(2*(c + I*d)^2*(a^3*d^2 - (3*I)*a^2*b*d^2 -
3*a*b^2*d^2 + b^3*c*(I*c + 2*d))*(e + f*x) - 2*b^3*(c^2 + d^2)^2*Log[Cos[e + f*x]] + (b*c - a*d)^2*(2*a*c*d +
b*(c^2 + 3*d^2))*Log[(c*Cos[e + f*x] + d*Sin[e + f*x])^2]) + d*(2*(c + I*d)*(a^3*d^2*((-I)*d^2 + c*d*(1 + I*e
+ I*f*x) + c^2*(e + f*x)) + 3*a^2*b*c*d^2*((-I)*c*(-I + e + f*x) + d*(I + e + f*x)) + 3*a*b^2*c*d*(c^2 - I*d^2
*(e + f*x) - c*d*(I + e + f*x)) + b^3*c^2*((2*I)*d^2*(e + f*x) + I*c^2*(I + e + f*x) + c*d*(I + e + f*x))) - 2
*b^3*c*(c^2 + d^2)^2*Log[Cos[e + f*x]] + c*(b*c - a*d)^2*(2*a*c*d + b*(c^2 + 3*d^2))*Log[(c*Cos[e + f*x] + d*S
in[e + f*x])^2])*Sin[e + f*x] - (2*I)*c*(b*c - a*d)^2*(2*a*c*d + b*(c^2 + 3*d^2))*ArcTan[Tan[e + f*x]]*(c*Cos[
e + f*x] + d*Sin[e + f*x]))*(a + b*Tan[e + f*x])^3)/(2*c*(c - I*d)^2*(c + I*d)^2*d^2*f*(a*Cos[e + f*x] + b*Sin
[e + f*x])^3*(c + d*Tan[e + f*x])^2)

________________________________________________________________________________________

Maple [B]  time = 0.038, size = 671, normalized size = 3. \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*tan(f*x+e))^3/(c+d*tan(f*x+e))^2,x)

[Out]

-1/f*a^3/(c^2+d^2)^2*ln(1+tan(f*x+e)^2)*c*d+3/2/f/(c^2+d^2)^2*ln(1+tan(f*x+e)^2)*a^2*b*c^2-3/2/f/(c^2+d^2)^2*l
n(1+tan(f*x+e)^2)*a^2*b*d^2+3/f/(c^2+d^2)^2*ln(1+tan(f*x+e)^2)*a*b^2*c*d-1/2/f/(c^2+d^2)^2*ln(1+tan(f*x+e)^2)*
b^3*c^2+1/2/f/(c^2+d^2)^2*ln(1+tan(f*x+e)^2)*b^3*d^2+1/f*a^3/(c^2+d^2)^2*arctan(tan(f*x+e))*c^2-1/f*a^3/(c^2+d
^2)^2*arctan(tan(f*x+e))*d^2+6/f/(c^2+d^2)^2*arctan(tan(f*x+e))*a^2*b*c*d-3/f/(c^2+d^2)^2*arctan(tan(f*x+e))*a
*b^2*c^2+3/f/(c^2+d^2)^2*arctan(tan(f*x+e))*a*b^2*d^2-2/f/(c^2+d^2)^2*arctan(tan(f*x+e))*b^3*c*d-1/f*a^3*d/(c^
2+d^2)/(c+d*tan(f*x+e))+3/f/(c^2+d^2)/(c+d*tan(f*x+e))*a^2*b*c-3/f/d/(c^2+d^2)/(c+d*tan(f*x+e))*a*b^2*c^2+1/f/
d^2/(c^2+d^2)/(c+d*tan(f*x+e))*b^3*c^3+2/f*a^3/(c^2+d^2)^2*d*ln(c+d*tan(f*x+e))*c-3/f/(c^2+d^2)^2*ln(c+d*tan(f
*x+e))*a^2*b*c^2+3/f/(c^2+d^2)^2*d^2*ln(c+d*tan(f*x+e))*a^2*b-6/f/(c^2+d^2)^2*d*ln(c+d*tan(f*x+e))*a*b^2*c+1/f
/(c^2+d^2)^2/d^2*ln(c+d*tan(f*x+e))*b^3*c^4+3/f/(c^2+d^2)^2*ln(c+d*tan(f*x+e))*b^3*c^2

________________________________________________________________________________________

Maxima [A]  time = 1.79262, size = 419, normalized size = 1.88 \begin{align*} \frac{\frac{2 \,{\left ({\left (a^{3} - 3 \, a b^{2}\right )} c^{2} + 2 \,{\left (3 \, a^{2} b - b^{3}\right )} c d -{\left (a^{3} - 3 \, a b^{2}\right )} d^{2}\right )}{\left (f x + e\right )}}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} + \frac{2 \,{\left (b^{3} c^{4} + 3 \, a^{2} b d^{4} - 3 \,{\left (a^{2} b - b^{3}\right )} c^{2} d^{2} + 2 \,{\left (a^{3} - 3 \, a b^{2}\right )} c d^{3}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{4} d^{2} + 2 \, c^{2} d^{4} + d^{6}} + \frac{{\left ({\left (3 \, a^{2} b - b^{3}\right )} c^{2} - 2 \,{\left (a^{3} - 3 \, a b^{2}\right )} c d -{\left (3 \, a^{2} b - b^{3}\right )} d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} + \frac{2 \,{\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )}}{c^{3} d^{2} + c d^{4} +{\left (c^{2} d^{3} + d^{5}\right )} \tan \left (f x + e\right )}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))^3/(c+d*tan(f*x+e))^2,x, algorithm="maxima")

[Out]

1/2*(2*((a^3 - 3*a*b^2)*c^2 + 2*(3*a^2*b - b^3)*c*d - (a^3 - 3*a*b^2)*d^2)*(f*x + e)/(c^4 + 2*c^2*d^2 + d^4) +
 2*(b^3*c^4 + 3*a^2*b*d^4 - 3*(a^2*b - b^3)*c^2*d^2 + 2*(a^3 - 3*a*b^2)*c*d^3)*log(d*tan(f*x + e) + c)/(c^4*d^
2 + 2*c^2*d^4 + d^6) + ((3*a^2*b - b^3)*c^2 - 2*(a^3 - 3*a*b^2)*c*d - (3*a^2*b - b^3)*d^2)*log(tan(f*x + e)^2
+ 1)/(c^4 + 2*c^2*d^2 + d^4) + 2*(b^3*c^3 - 3*a*b^2*c^2*d + 3*a^2*b*c*d^2 - a^3*d^3)/(c^3*d^2 + c*d^4 + (c^2*d
^3 + d^5)*tan(f*x + e)))/f

________________________________________________________________________________________

Fricas [B]  time = 2.00547, size = 1025, normalized size = 4.6 \begin{align*} \frac{2 \, b^{3} c^{3} d^{2} - 6 \, a b^{2} c^{2} d^{3} + 6 \, a^{2} b c d^{4} - 2 \, a^{3} d^{5} + 2 \,{\left ({\left (a^{3} - 3 \, a b^{2}\right )} c^{3} d^{2} + 2 \,{\left (3 \, a^{2} b - b^{3}\right )} c^{2} d^{3} -{\left (a^{3} - 3 \, a b^{2}\right )} c d^{4}\right )} f x +{\left (b^{3} c^{5} + 3 \, a^{2} b c d^{4} - 3 \,{\left (a^{2} b - b^{3}\right )} c^{3} d^{2} + 2 \,{\left (a^{3} - 3 \, a b^{2}\right )} c^{2} d^{3} +{\left (b^{3} c^{4} d + 3 \, a^{2} b d^{5} - 3 \,{\left (a^{2} b - b^{3}\right )} c^{2} d^{3} + 2 \,{\left (a^{3} - 3 \, a b^{2}\right )} c d^{4}\right )} \tan \left (f x + e\right )\right )} \log \left (\frac{d^{2} \tan \left (f x + e\right )^{2} + 2 \, c d \tan \left (f x + e\right ) + c^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) -{\left (b^{3} c^{5} + 2 \, b^{3} c^{3} d^{2} + b^{3} c d^{4} +{\left (b^{3} c^{4} d + 2 \, b^{3} c^{2} d^{3} + b^{3} d^{5}\right )} \tan \left (f x + e\right )\right )} \log \left (\frac{1}{\tan \left (f x + e\right )^{2} + 1}\right ) - 2 \,{\left (b^{3} c^{4} d - 3 \, a b^{2} c^{3} d^{2} + 3 \, a^{2} b c^{2} d^{3} - a^{3} c d^{4} -{\left ({\left (a^{3} - 3 \, a b^{2}\right )} c^{2} d^{3} + 2 \,{\left (3 \, a^{2} b - b^{3}\right )} c d^{4} -{\left (a^{3} - 3 \, a b^{2}\right )} d^{5}\right )} f x\right )} \tan \left (f x + e\right )}{2 \,{\left ({\left (c^{4} d^{3} + 2 \, c^{2} d^{5} + d^{7}\right )} f \tan \left (f x + e\right ) +{\left (c^{5} d^{2} + 2 \, c^{3} d^{4} + c d^{6}\right )} f\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))^3/(c+d*tan(f*x+e))^2,x, algorithm="fricas")

[Out]

1/2*(2*b^3*c^3*d^2 - 6*a*b^2*c^2*d^3 + 6*a^2*b*c*d^4 - 2*a^3*d^5 + 2*((a^3 - 3*a*b^2)*c^3*d^2 + 2*(3*a^2*b - b
^3)*c^2*d^3 - (a^3 - 3*a*b^2)*c*d^4)*f*x + (b^3*c^5 + 3*a^2*b*c*d^4 - 3*(a^2*b - b^3)*c^3*d^2 + 2*(a^3 - 3*a*b
^2)*c^2*d^3 + (b^3*c^4*d + 3*a^2*b*d^5 - 3*(a^2*b - b^3)*c^2*d^3 + 2*(a^3 - 3*a*b^2)*c*d^4)*tan(f*x + e))*log(
(d^2*tan(f*x + e)^2 + 2*c*d*tan(f*x + e) + c^2)/(tan(f*x + e)^2 + 1)) - (b^3*c^5 + 2*b^3*c^3*d^2 + b^3*c*d^4 +
 (b^3*c^4*d + 2*b^3*c^2*d^3 + b^3*d^5)*tan(f*x + e))*log(1/(tan(f*x + e)^2 + 1)) - 2*(b^3*c^4*d - 3*a*b^2*c^3*
d^2 + 3*a^2*b*c^2*d^3 - a^3*c*d^4 - ((a^3 - 3*a*b^2)*c^2*d^3 + 2*(3*a^2*b - b^3)*c*d^4 - (a^3 - 3*a*b^2)*d^5)*
f*x)*tan(f*x + e))/((c^4*d^3 + 2*c^2*d^5 + d^7)*f*tan(f*x + e) + (c^5*d^2 + 2*c^3*d^4 + c*d^6)*f)

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))**3/(c+d*tan(f*x+e))**2,x)

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [B]  time = 1.89217, size = 603, normalized size = 2.7 \begin{align*} \frac{\frac{2 \,{\left (a^{3} c^{2} - 3 \, a b^{2} c^{2} + 6 \, a^{2} b c d - 2 \, b^{3} c d - a^{3} d^{2} + 3 \, a b^{2} d^{2}\right )}{\left (f x + e\right )}}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} + \frac{{\left (3 \, a^{2} b c^{2} - b^{3} c^{2} - 2 \, a^{3} c d + 6 \, a b^{2} c d - 3 \, a^{2} b d^{2} + b^{3} d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} + \frac{2 \,{\left (b^{3} c^{4} - 3 \, a^{2} b c^{2} d^{2} + 3 \, b^{3} c^{2} d^{2} + 2 \, a^{3} c d^{3} - 6 \, a b^{2} c d^{3} + 3 \, a^{2} b d^{4}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{c^{4} d^{2} + 2 \, c^{2} d^{4} + d^{6}} - \frac{2 \,{\left (b^{3} c^{4} \tan \left (f x + e\right ) - 3 \, a^{2} b c^{2} d^{2} \tan \left (f x + e\right ) + 3 \, b^{3} c^{2} d^{2} \tan \left (f x + e\right ) + 2 \, a^{3} c d^{3} \tan \left (f x + e\right ) - 6 \, a b^{2} c d^{3} \tan \left (f x + e\right ) + 3 \, a^{2} b d^{4} \tan \left (f x + e\right ) + 3 \, a b^{2} c^{4} - 6 \, a^{2} b c^{3} d + 2 \, b^{3} c^{3} d + 3 \, a^{3} c^{2} d^{2} - 3 \, a b^{2} c^{2} d^{2} + a^{3} d^{4}\right )}}{{\left (c^{4} d + 2 \, c^{2} d^{3} + d^{5}\right )}{\left (d \tan \left (f x + e\right ) + c\right )}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))^3/(c+d*tan(f*x+e))^2,x, algorithm="giac")

[Out]

1/2*(2*(a^3*c^2 - 3*a*b^2*c^2 + 6*a^2*b*c*d - 2*b^3*c*d - a^3*d^2 + 3*a*b^2*d^2)*(f*x + e)/(c^4 + 2*c^2*d^2 +
d^4) + (3*a^2*b*c^2 - b^3*c^2 - 2*a^3*c*d + 6*a*b^2*c*d - 3*a^2*b*d^2 + b^3*d^2)*log(tan(f*x + e)^2 + 1)/(c^4
+ 2*c^2*d^2 + d^4) + 2*(b^3*c^4 - 3*a^2*b*c^2*d^2 + 3*b^3*c^2*d^2 + 2*a^3*c*d^3 - 6*a*b^2*c*d^3 + 3*a^2*b*d^4)
*log(abs(d*tan(f*x + e) + c))/(c^4*d^2 + 2*c^2*d^4 + d^6) - 2*(b^3*c^4*tan(f*x + e) - 3*a^2*b*c^2*d^2*tan(f*x
+ e) + 3*b^3*c^2*d^2*tan(f*x + e) + 2*a^3*c*d^3*tan(f*x + e) - 6*a*b^2*c*d^3*tan(f*x + e) + 3*a^2*b*d^4*tan(f*
x + e) + 3*a*b^2*c^4 - 6*a^2*b*c^3*d + 2*b^3*c^3*d + 3*a^3*c^2*d^2 - 3*a*b^2*c^2*d^2 + a^3*d^4)/((c^4*d + 2*c^
2*d^3 + d^5)*(d*tan(f*x + e) + c)))/f